﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Web.SessionState;
using SES.CMS.DO;
using SES.CMS.BL;

namespace SES.CMS
{
    public partial class SanPham : BasePage
    {
        ShopingCart vpp = new ShopingCart();
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!string.IsNullOrEmpty(Request.QueryString["ID"]))
            {
                int loaiSanPhamID = int.Parse(Request.QueryString["ID"].ToString());
                InitForm(loaiSanPhamID);
            }
        }

        protected void InitForm(int loaiSanPhamID)
        {
            DataTable dtProduct = new cmsLoaiSanPhamBL().SelectByPK(loaiSanPhamID);
            imgProductType.ImageUrl = "/Media/" + dtProduct.Rows[0]["HinhAnh"];


            if (Session["lang"].ToString() == "VN")
            {
                Page.Title = dtProduct.Rows[0]["TenLoaiSanPham"].ToString();
                lblProductTypeName.Text = dtProduct.Rows[0]["TenLoaiSanPham"].ToString();
                lblProductDescription.Text = dtProduct.Rows[0]["MoTa"].ToString();
            }
            if (Session["lang"].ToString() == "EN")
            {
                Page.Title = dtProduct.Rows[0]["ProductTypeName"].ToString();
                lblProductTypeName.Text = dtProduct.Rows[0]["ProductTypeName"].ToString();
                lblProductDescription.Text = dtProduct.Rows[0]["Description"].ToString();
            }
 
        }

        protected string FriendlyUrl(string strTitle)
        {
            return Ultility.Change_AV(strTitle);
        }

    }
}
